package com.xyh;

import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class TestMain {
    public static void main(String[] args) throws  Exception{
          final CloseableHttpClient  httpClient = HttpClients.createDefault();
         final String url = "http://localhost:8081/toHello";
        for(int i=0;i<6;i++){
            Thread t=new Thread(){
                @Override
                public void run() {
                    try {
                        HttpGet httpGet=new HttpGet(url);
                        HttpResponse response=httpClient.execute(httpGet);
                        System.out.println(EntityUtils.toString(response.getEntity()));
                    }catch (Exception e){
                         e.printStackTrace();
                    }
                }
            };
            t.start();
        }
        Thread.sleep(1500);
    }
}
